package com.bw.zg3park2212.viewmodel

import androidx.lifecycle.MutableLiveData
import com.bw.base.entity.GongAddParam
import com.bw.base.entity.GongEntity
import com.bw.base.entity.GongEntityItem
import com.bw.base.mvvm.BaseViewModel
import com.bw.base.net.ApiService
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

@HiltViewModel
class GongViewModel @Inject constructor(val apiService: ApiService): BaseViewModel() {
    var gongSuccse=MutableLiveData<GongEntity>()
    fun getGong(page:Int,size:Int){
        httpRequst(
            {apiService.getGongGao(page, size)},
            gongSuccse::postValue
        )
    }
    var gongAddSuccse=MutableLiveData<GongEntityItem>()
    fun getAddGong(gongAddParam: GongAddParam){
        httpRequst(
            {apiService.getGongAdd(gongAddParam)},
            gongAddSuccse::postValue
        )
    }
}